package Utils;

import java.io.File;

/**
 * The type Is image.
 *
 * @author dzr
 * @version 1.0
 */
public class IsImage {
    /**
     * Judge whether the type of file is an image.
     *
     * @param file the file
     * @return the result
     */
    public static boolean isImage(File file){
        boolean res = false;
        String name = file.getName();
        if (name.endsWith(".jpg") ||
                name.endsWith(".png") ||
                name.endsWith(".bmp") ||
                name.endsWith(".gif")){
            res = true;
        }
        return res;
    }
}
